<template>
  <div></div>
</template>

<script setup>
import { onBeforeMount , getCurrentInstance } from 'vue';
import { useRouter } from 'vue-router' ;

const { proxy } = getCurrentInstance();
const router = useRouter();

onBeforeMount( ()=>{
    console.log( '注销登录' );
    sessionStorage.removeItem( 'token' );
    proxy.$root.logged = false ;
    router.push( { name: 'bookList' } );
});

</script>